/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 * Description: alg remote lookup.
 * Author: liutianming
 * Create: 2022-11-28
 */

#ifndef ALG_REMOTE_UPDATE_H
#define ALG_REMOTE_UPDATE_H

#include "alg_embedding_service.h"

namespace hccl {

class AlgHdcsRemoteUpdate : public AlgEmbeddingService {
public:
    explicit AlgHdcsRemoteUpdate();
    ~AlgHdcsRemoteUpdate() = default;
    HcclResult Process(HcclOpPtr opPtr) override;

private:
    HcclResult AlgUpdate(HcclOperator<EmbeddingServiceParam> *opPtr);
    HcclResult AlgWaitUpdate(HcclOperator<EmbeddingServiceParam> *opPtr);
    HcclResult AlgUpdateKeyReduce(HcclOperator<EmbeddingServiceParam> *opPtr);
    HcclResult AlgUpdateReduceSum(HcclOperator<EmbeddingServiceParam> *opPtr);
    HcclResult AlgUpdateSendRequest(HcclOperator<EmbeddingServiceParam> *opPtr);
    HcclResult AlgUpdateRecvResponse(HcclOperator<EmbeddingServiceParam> *opPtr);
    HcclResult AlgUpdateResetUniqueHandle(HcclOperator<EmbeddingServiceParam> *opPtr);

    FuncTable funcTable_;
};
}
#endif
